import QtQuick 2.9
import QtQuick.Controls 2.5

Rectangle {
    id: root

    property alias  text: txtText.text
    property bool showAsPassword: false

    //--------------------------
    width: parent.width
    height: parent.height
    radius: 6
    color: "transparent"
    border.color: txtText.activeFocus ? "#2E75B6" : "#222"

    TextInput {
        id: txtText
        width: parent.width
        height: parent.height
        horizontalAlignment: TextInput.AlignHCenter
        verticalAlignment: TextInput.AlignVCenter
        font.pixelSize: height * 0.4

        echoMode: root.showAsPassword ? TextInput.Password : TextInput.Normal
    }
}
